package com.zbkj.front.controller.mszs;

import com.zbkj.common.request.mszs.MszsCenterRequest;
import com.zbkj.common.response.CommonResult;
import com.zbkj.common.response.UserCenterResponse;
import com.zbkj.common.response.mszs.MszsCenterResponse;
import com.zbkj.front.service.mszs.MszsCenterService;
import com.zbkj.service.service.user.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * 民宿助手移动端-包含个人中心和数据中心-相关接口controller
 * @author JIANTAO
 */
@Slf4j
@RestController("MszsCenterController")
@RequestMapping("api/front/mszs/center")
@Api(tags = "民宿助手-个人中心/数据中心")
public class MszsCenterController {

    @Autowired
    private MszsCenterService centerService;

    @Autowired
    private UserService userService;

    @ApiOperation(value = "数据统计")
    @RequestMapping(value = "/statistics", method = RequestMethod.GET)
    public CommonResult<MszsCenterResponse> getIndexInfo(@ModelAttribute MszsCenterRequest request) {
        return CommonResult.success(centerService.statistics(request));
    }

    @ApiOperation(value = "个人中心-用户信息")
    @RequestMapping(value = "/user", method = RequestMethod.GET)
    public CommonResult<UserCenterResponse> getUserCenter() {
        return CommonResult.success(userService.getUserCenter());
    }


}



